﻿@model AutoClub.Models.AddRaceModel
@using AutoClub.Resources;
@using AutoClub.Support;
@using AutoClub.Models;
@{
    ViewBag.Title = "Nueva Carrera";
}
<h2>
    Nueva Carrera</h2>
    <script src="@Url.Content("~/Scripts/jquery.validate.min.js")" type="text/javascript"></script>
    <script src="@Url.Content("~/Scripts/jquery.validate.unobtrusive.min.js")" type="text/javascript"></script>
    <script src="@Url.Content("~/Scripts/autoclub.datepicker.js")" type="text/javascript"></script>
    <script src="@Url.Content("~/Scripts/autoclub.race.add.js")" type="text/javascript"></script>
@using (Html.BeginForm())
{
    @Html.ValidationSummary(true)
    <fieldset>
        <legend>Carrera</legend>
        <div class="editor-label">
            @Html.LabelFor(model => model.SelectedCategory)
        </div>
        <div class="editor-field">
            @Html.DropDownListFor(model => model.SelectedCategory, Model.Categories.ToDropDownList(c => c.Id, c => c.Description, Model.SelectedCategory), PageResources.RequireDropDownFieldMessage)
            @Html.ValidationMessageFor(model => model.SelectedCategory)
        </div>
        <div class="editor-label">
            @Html.LabelFor(model => model.StartDate)
        </div>
        <div class="editor-field">
            @Html.TextBoxFor(model => model.StartDate, new { id = "startdate", @class = "center-aligned-text" })
            @Html.ValidationMessageFor(model => model.StartDate)
        </div>
        <div class="editor-label">
            @Html.LabelFor(model => model.EndDate)
        </div>
        <div class="editor-field">
            @Html.TextBoxFor(model => model.EndDate, new { id = "enddate", @class = "center-aligned-text" })
            @Html.ValidationMessageFor(model => model.EndDate)
        </div>
        <div class="editor-label">
            @Html.LabelFor(model => model.MechanicsMaxAmount)
        </div>
        <div class="editor-field">
            @Html.TextBoxFor(model => model.MechanicsMaxAmount, new { @class = "center-aligned-text" })
            @Html.ValidationMessageFor(model => model.MechanicsMaxAmount)
        </div>
        <p>
            <input type="submit" value="Crear Nueva" />
        </p>
    </fieldset>
}

<script language="javascript" type="text/javascript">
    AutoClub.Race.Add.Init();
  </script>
